﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Configuration;
using System.Diagnostics;

namespace NDownloader
{
    class Program
    {
        static void Main(string[] args)
        {
            string strDownloadURL = ConfigurationManager.AppSettings.Get("DownloadURL");
            string strDownloadFolder = ConfigurationManager.AppSettings.Get("DownloadFolder");
            string strProjectName = ConfigurationManager.AppSettings.Get("ProjectName");
            string[] strArrFileExtensions = ConfigurationManager.AppSettings.Get("FileExtensions").ToString().Split(',');

            Debug.WriteLine(strDownloadURL);
            Debug.WriteLine(strDownloadFolder);
            Debug.WriteLine(strProjectName);

            Console.WriteLine(strDownloadURL);
            Console.WriteLine(strDownloadFolder);
            Console.WriteLine(strProjectName);


            List<String> lstStrLinks;

            lstStrLinks = NDownloader.URLScan.GetLinks(strDownloadURL, strArrFileExtensions);

            SaveFromURL.Save(strDownloadURL, lstStrLinks, strDownloadFolder, strProjectName);  

        }
    }
}